import { Injectable } from '@angular/core';
import {SimpleJsonFormatter, SimplePipe} from '../../../ng-tools';
import {StatusPipe} from '../../../ng-tools/src/components/badge/status.pipe';

@Injectable({
  providedIn: 'root'
})
export class SystemGroupFormatterService {
  // announcement: "欢迎来盘"
  // desc: "这是一个游戏群"
  // gName: "扫雷5-30/6包/1.8倍"
  // gid: "0000000377"
  // headImgFile: "3b2edf370b054abfa38e93440a479b5b.jpg"
  // high_account: 30
  // is_join_special_reward: 0
  // level: null
  // low_account: 5
  // master_fl_perc: null
  // multi: 1
  // nickName: "管理员"
  // ownerUserId: 99750096
  // play_type: 1
  // privateGroupId: "game_4"
  // robot_group_id: 3
  // send_packet_user_of_JL: null
  // status: 1
  // times: null
  gName: SimpleJsonFormatter = {propName: 'gName', displayName: '群名称'};
  desc: SimpleJsonFormatter = {propName: 'desc', displayName: '群说明'};
  nickName: SimpleJsonFormatter = {propName: 'nickName', displayName: '群主'};
  announcement: SimpleJsonFormatter = {propName: 'announcement', displayName: '群公告'};
  play_type: SimpleJsonFormatter = {propName: 'play_type', displayName: '群类型'};
  userImage: SimpleJsonFormatter = {propName: 'userImage', displayName: '群头像'};
  low_account: SimpleJsonFormatter = {propName: 'low_account', displayName: '金额下限'};
  high_account: SimpleJsonFormatter = {propName: 'high_account', displayName: '金额上限'};
  multi: SimpleJsonFormatter = {propName: 'multi', displayName: '倍数'};
    status: SimpleJsonFormatter = {propName: 'status', displayName: '群状态'};
  robot_group_id: SimpleJsonFormatter = {propName: 'robot_group_id', displayName: '机器人组ID'};
  master_fl_perc: SimpleJsonFormatter = {propName: 'master_fl_perc', displayName: '群主返利比'};
  constructor(public statusPipe: StatusPipe ) {
    this.play_type.pipe = new SimplePipe(this.statusPipe, [[1, 2, 3], ['扫雷群', '牛牛红包群', '红包接龙群']]);
    this.status.pipe = new SimplePipe(this.statusPipe, [[0, 1], ['冻结', '可用']]);
  }
  get formatter() {
    return [
        this.gName,
        this.announcement,
        this.play_type,
        this.userImage,
        this.low_account,
        this.high_account,
        this.multi,
        this.robot_group_id
    ];
  }
  get personalFormatter() {
      return [
          this.gName,
          this.desc,
          this.announcement,
          this.nickName,
          this.play_type,
          this.userImage,
          this.low_account,
          this.high_account,
          this.multi,
          this.robot_group_id,
          this.master_fl_perc
      ];
  }
  get personalDetailFormatter() {
      return [
          this.gName,
          this.master_fl_perc,
      ];
  }
}
